/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 */
package com.jeesite.modules.settlement.entity.investorcarcontract;

import com.jeesite.common.entity.DataEntity;
import com.jeesite.common.mybatis.annotation.Column;
import com.jeesite.common.mybatis.annotation.JoinTable;
import com.jeesite.common.mybatis.annotation.Table;
import com.jeesite.modules.base.entity.cars.Tcar;
import com.jeesite.modules.order.entity.serviceorder.ServiceOrder;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

/**
 * 资方汽车供需合同Entity
 * @author LV
 * @version 2021-03-06
 */
@Table(name="t_investor_car_contract_detail", alias="a", columns={
		@Column(name="investor_car_contract_detail_id", attrName="investorCarContractDetailId", label="资方汽车供需合同明细ID", isPK=true),
		@Column(name="frame_number", attrName="frameNumber", label="车架号"),
		@Column(name="service_order_id", attrName="serviceOrderId", label="服务订单"),
		@Column(name="car_id", attrName="carId", label="车辆"),
		@Column(name="calculate_price", attrName="calculatePrice", label="计算车价"),
		@Column(name="price", attrName="price", label="单价", comment="单价（元）"),
		@Column(name="amount", attrName="amount", label="金额含税合计", comment="金额含税合计（元）"),
		@Column(name="invoice", attrName="invoice", label="发票信息"),
		@Column(name="remark", attrName="remark", label="备注"),
		@Column(name="investor_car_contract_id", attrName="investorCarContractId.investorCarContractId", label="资方汽车供需合同ID"),
	}, joinTable={
        @JoinTable(type= JoinTable.Type.LEFT_JOIN, entity= Tcar.class, attrName="tcar", alias="b",
                on="b.car_id = a.car_id", columns={
                @Column(name="car_id", label="车辆编码", isPK=true),
                @Column(name="car_name", label="车辆名称", isQuery=false),
        }),
        @JoinTable(type= JoinTable.Type.LEFT_JOIN, entity= ServiceOrder.class, attrName="serviceOrder", alias="c",
                on="c.service_order_id = a.service_order_id", columns={
                @Column(name="service_order_id", label="服务订单ID", isPK=true),
                @Column(name="service_order_code", label="服务订单编号", isQuery=false),
        }),
}, orderBy="a.investor_car_contract_detail_id ASC"
)
public class InvestorCarContractDetail extends DataEntity<InvestorCarContractDetail> {
	
	private static final long serialVersionUID = 1L;
	private String investorCarContractDetailId;		// 资方汽车供需合同明细ID
	private String frameNumber;		// 车架号
	private String serviceOrderId;		// 服务订单
	private String serviceOrderName;		// 服务订单
	private String carId;		// 车辆
	private String carName;		// 车辆
	private Double calculatePrice;		// 计算车价
	private Double price;		// 单价（元）
	private Double amount;		// 金额含税合计（元）
	private String invoice;		// 发票信息
	private String remark;		// 备注
	private InvestorCarContract investorCarContractId;		// 资方汽车供需合同ID 父类
	private ServiceOrder serviceOrder;
	private Tcar tcar;


	public InvestorCarContractDetail() {
		this(null);
	}


	public InvestorCarContractDetail(InvestorCarContract investorCarContractId){
		this.investorCarContractId = investorCarContractId;
	}
	
	public String getInvestorCarContractDetailId() {
		return investorCarContractDetailId;
	}

	public void setInvestorCarContractDetailId(String investorCarContractDetailId) {
		this.investorCarContractDetailId = investorCarContractDetailId;
	}
	
	@NotBlank(message="车架号不能为空")
	@Length(min=0, max=100, message="车架号长度不能超过 100 个字符")
	public String getFrameNumber() {
		return frameNumber;
	}

	public void setFrameNumber(String frameNumber) {
		this.frameNumber = frameNumber;
	}
	
	@Length(min=0, max=64, message="服务订单长度不能超过 64 个字符")
	public String getServiceOrderId() {
		return serviceOrderId;
	}

	public void setServiceOrderId(String serviceOrderId) {
		this.serviceOrderId = serviceOrderId;
	}
	
	@Length(min=0, max=64, message="车辆长度不能超过 64 个字符")
	public String getCarId() {
		return carId;
	}

	public void setCarId(String carId) {
		this.carId = carId;
	}
	
	public Double getCalculatePrice() {
		return calculatePrice;
	}

	public void setCalculatePrice(Double calculatePrice) {
		this.calculatePrice = calculatePrice;
	}
	
	@NotNull(message="单价不能为空")
	public Double getPrice() {
		return price;
	}

	public void setPrice(Double price) {
		this.price = price;
	}
	
	@NotNull(message="金额含税合计不能为空")
	public Double getAmount() {
		return amount;
	}

	public void setAmount(Double amount) {
		this.amount = amount;
	}
	
	@Length(min=0, max=255, message="备注长度不能超过 255 个字符")
	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}
	
	public InvestorCarContract getInvestorCarContractId() {
		return investorCarContractId;
	}

	public void setInvestorCarContractId(InvestorCarContract investorCarContractId) {
		this.investorCarContractId = investorCarContractId;
	}

    public ServiceOrder getServiceOrder() {
        return serviceOrder;
    }

    public void setServiceOrder(ServiceOrder serviceOrder) {
        this.serviceOrder = serviceOrder;
    }

    public Tcar getTcar() {
        return tcar;
    }

    public void setTcar(Tcar tcar) {
        this.tcar = tcar;
    }

    public String getInvoice() {
        return invoice;
    }

    public void setInvoice(String invoice) {
        this.invoice = invoice;
    }

    public String getCarName() {
        return carName;
    }

    public void setCarName(String carName) {
        this.carName = carName;
    }

    public String getServiceOrderName() {
        return serviceOrderName;
    }

    public void setServiceOrderName(String serviceOrderName) {
        this.serviceOrderName = serviceOrderName;
    }
}